<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@include file="/res/include/base-head.jsp"%>
<%@include file="/res/include/jquery-easyui.jsp"%>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/res/js/pubSysParam/pubSysParam.js"></script>
</head>
<body>

	<div class="easyui-layout" data-options="fit:true">
	<form id="data-form"  style="width:100%;">
		<div data-options="region:'center',border:false">
			<table id="datagrid"
				data-options="url:'${pageContext.request.contextPath}/pub/sysParam/list',toolbar:'#toolbar'">
				<thead>
					<tr>
						<th data-options="field:'id',width:100">id</th>
						<th data-options="field:'key',width:200">键</th>
						<th
							data-options="field:'value',width:400,align:'center',formatter:formatValue">值</th>
						<th data-options="field:'remark',width:600,align:'center'">描述</th>
					</tr>
				</thead>
			</table>
		</div>
		<div id="toolbar" style="padding:2px;">
			<a href="javascript:void(0);" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="admin.pubSysParam.add();">发布</a>
		</div>
	</form>
	</div>
</body>
<script>
	function formatValue(value, row, index) {
		var html = ""
		var pubName=row.key.replace("pub_upgrade_","");
		if(row.key == 'pub_upgrade_isWebCheck'){
			if(value==1){
				html += '<input  type="radio" value="1" name="'+pubName+'" checked/><span>是</span>';
			}else{
				html += '<input  type="radio" value="1" name="'+pubName+'"/><span>是</span>';
			}
			if(value==2){
				html += '<input  type="radio" value="2" name="'+pubName+'" checked/><span>否</span>';
			}else{
				html += '<input  type="radio" value="2" name="'+pubName+'"/><span>否</span>';
			}
		}else if(row.key == 'pub_upgrade_isSilence'){
			if(value==1){
				html += '<input  type="radio" value="1" name="'+pubName+'" checked/><span>是</span>';
			}else{
				html += '<input  type="radio" value="1" name="'+pubName+'"/><span>是</span>';
			}
			if(value==2){
				html += '<input  type="radio" value="2" name="'+pubName+'" checked/><span>否</span>';
			}else{
				html += '<input  type="radio" value="2" name="'+pubName+'"/><span>否</span>';
			}
		}else if(row.key == 'pub_upgrade_isRestart'){
			if(value==1){
				html += '<input  type="radio" value="1" name="'+pubName+'" checked/><span>是</span>';
			}else{
				html += '<input  type="radio" value="1" name="'+pubName+'"/><span>是</span>';
			}
			if(value==2){
				html += '<input  type="radio" value="2" name="'+pubName+'" checked/><span>否</span>';
			}else{
				html += '<input  type="radio" value="2" name="'+pubName+'"/><span>否</span>';
			}
		}else if(row.key == 'pub_upgrade_isUpgrade'){
			if(value==1){
				html += '<input  type="radio" value="1" name="'+pubName+'" checked/><span>是</span>';
			}else{
				html += '<input  type="radio" value="1" name="'+pubName+'"/><span>是</span>';
			}
			if(value==2){
				html += '<input  type="radio" value="2" name="'+pubName+'" checked/><span>否</span>';
			}else{
				html += '<input  type="radio" value="2" name="'+pubName+'"/><span>否</span>';
			}
		}else if(row.key == 'pub_upgrade_isUpdContentOnly'){
			if(value==1){
				html += '<input  type="radio" value="1" name="'+pubName+'" checked/><span>是</span>';
			}else{
				html += '<input  type="radio" value="1" name="'+pubName+'"/><span>是</span>';
			}
			if(value==2){
				html += '<input  type="radio" value="2" name="'+pubName+'" checked/><span>否</span>';
			}else{
				html += '<input  type="radio" value="2" name="'+pubName+'"/><span>否</span>';
			}
		}else if(row.key == 'pub_upgrade_content'){
			html = '<textarea cols="40" rows="4" name="'+pubName+'">'+value+'</textarea>';
		}else{
			html = '<input  type="text" value="'+value+'" width="200px" name="'+pubName+'"/>'
		}
		return html;
	}
</script>
</html>
